<include file="Public/header" title="角色列表" />

<div id="page-wrapper">
    
    <div class="row">
        <div class="col-md-6">
            <a href="{:U('Role/add')}" class="btn btn-success">添加角色</a>
        </div>

    </div>
    <table class="table table-hover table-striped">
        <thead>
            <tr>
               <th class="tc" width="5%"><input class="allChoose" name="" id='check' type="checkbox"></th>
                <th>ID</th>
                <th>角色名称</th>
                <th>角色权限</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
            <tr>
                <td class="tc">
                    <if condition="$vo['id'] neq 1">
                    <input name="ids[]" value="{$vo.id}" class="check" type="checkbox">
                    </if>
                    </td>
                    <td>{$vo.id}</td>
                    <td>{$vo.rolename}</td>
                    <td>
                    <if condition="$vo['prilist'] eq '*'">所有权限
                        <else />
                        {$vo.name}
                    </if>
                    </td>
                <td><a href="__CONTROLLER__/edit/id/{$vo.id}">编辑</a> | <a href="__CONTROLLER__/del/id/{$vo.id}" style="color:red;" onclick="javascript:return del('您真的确定要删除吗？\n\n删除后将不能恢复!');">删除</a></td>
            </tr>
        </volist>
        </tbody>
    </table>
    {$page}
</div>

<script type="text/javascript">
    $("#check").click(function(){

        if($('#check').is(':checked')){
            $(".check").attr("checked","checked")
        }else{
            $(".check").removeAttr("checked")
        }
    })
</script>
<include file="Public/footer" />